package cn.gson.springboot.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the operation_arrange database table.
 * 
 */
@Entity
@Table(name="operation_arrange")
@NamedQuery(name="OperationArrange.findAll", query="SELECT o FROM OperationArrange o")
public class OperationArrange implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="operation_id")
	private int operationId;

	@Temporal(TemporalType.DATE)
	@Column(name="oparrange_date")
	private Date oparrangeDate;

	@Column(name="oparrange_endtime")
	private String oparrangeEndtime;

	@Column(name="oparrange_money")
	private BigDecimal oparrangeMoney;

	@Column(name="oparrange_starttime")
	private String oparrangeStarttime;

	@Column(name="oparrange_state")
	private int oparrangeState;

	@Column(name="operation_reason")
	private String operationReason;

	//bi-directional many-to-one association to InhospitalReg
	@ManyToOne
	@JoinColumn(name="hosp_id")
	private InhospitalReg inhospitalReg;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="use_user_id")
	private User user1;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="user_id")
	private User user2;

	//bi-directional many-to-one association to OperationRoom
	@ManyToOne
	@JoinColumn(name="operationroom_id")
	private OperationRoom operationRoom;

	//bi-directional many-to-one association to OperationType
	@ManyToOne
	@JoinColumn(name="operationtype_id")
	private OperationType operationType;

	//bi-directional many-to-one association to OperationRecord
	@OneToMany(mappedBy="operationArrange")
	private List<OperationRecord> operationRecords;

	public OperationArrange() {
	}

	public int getOperationId() {
		return this.operationId;
	}

	public void setOperationId(int operationId) {
		this.operationId = operationId;
	}

	public Date getOparrangeDate() {
		return this.oparrangeDate;
	}

	public void setOparrangeDate(Date oparrangeDate) {
		this.oparrangeDate = oparrangeDate;
	}

	public String getOparrangeEndtime() {
		return this.oparrangeEndtime;
	}

	public void setOparrangeEndtime(String oparrangeEndtime) {
		this.oparrangeEndtime = oparrangeEndtime;
	}

	public BigDecimal getOparrangeMoney() {
		return this.oparrangeMoney;
	}

	public void setOparrangeMoney(BigDecimal oparrangeMoney) {
		this.oparrangeMoney = oparrangeMoney;
	}

	public String getOparrangeStarttime() {
		return this.oparrangeStarttime;
	}

	public void setOparrangeStarttime(String oparrangeStarttime) {
		this.oparrangeStarttime = oparrangeStarttime;
	}

	public int getOparrangeState() {
		return this.oparrangeState;
	}

	public void setOparrangeState(int oparrangeState) {
		this.oparrangeState = oparrangeState;
	}

	public String getOperationReason() {
		return this.operationReason;
	}

	public void setOperationReason(String operationReason) {
		this.operationReason = operationReason;
	}

	public InhospitalReg getInhospitalReg() {
		return this.inhospitalReg;
	}

	public void setInhospitalReg(InhospitalReg inhospitalReg) {
		this.inhospitalReg = inhospitalReg;
	}

	public User getUser1() {
		return this.user1;
	}

	public void setUser1(User user1) {
		this.user1 = user1;
	}

	public User getUser2() {
		return this.user2;
	}

	public void setUser2(User user2) {
		this.user2 = user2;
	}

	public OperationRoom getOperationRoom() {
		return this.operationRoom;
	}

	public void setOperationRoom(OperationRoom operationRoom) {
		this.operationRoom = operationRoom;
	}

	public OperationType getOperationType() {
		return this.operationType;
	}

	public void setOperationType(OperationType operationType) {
		this.operationType = operationType;
	}

	public List<OperationRecord> getOperationRecords() {
		return this.operationRecords;
	}

	public void setOperationRecords(List<OperationRecord> operationRecords) {
		this.operationRecords = operationRecords;
	}

	public OperationRecord addOperationRecord(OperationRecord operationRecord) {
		getOperationRecords().add(operationRecord);
		operationRecord.setOperationArrange(this);

		return operationRecord;
	}

	public OperationRecord removeOperationRecord(OperationRecord operationRecord) {
		getOperationRecords().remove(operationRecord);
		operationRecord.setOperationArrange(null);

		return operationRecord;
	}

}